Skip to content

Enable module state_dict compression, simplify compression logic #302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 28, 2025

Conversation

kylesayrs
Copy link
Contributor

@kylesayrs kylesayrs commented Apr 22, 2025

Purpose

  • Enable ModelCompressor.compress to compress individual modules, as is required by Reduce memory requirements
  • Reduce logic required for mapping modules to schemes
  • Reduce logic required for skipping zero_point saving

Changes

  • map_modules_to_quant_args -> map_module_to_scheme
    • Narrow the return type from a str, qargs, or tuple of qargs to just the scheme applied to that module
    • Reduce logic which parses this unnarrowed return type
  • SimplifyModelCompressor.compress
    • Condense zero_point handling into _skip_zp
    • Handle compressing individual modules

Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
@kylesayrs kylesayrs changed the title [Cleanup] map_module_to_scheme, _should_save_zp Enable module state_dict compression, simplify compression logic Apr 22, 2025
@kylesayrs kylesayrs requested review from dsikka and rahul-tuli April 22, 2025 21:04
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
rahul-tuli
rahul-tuli previously approved these changes Apr 23, 2025
Copy link
Member

@rahul-tuli rahul-tuli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! great job!

Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Copy link
Collaborator

@dsikka dsikka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to run all our e2e tests before this can land.

@kylesayrs
Copy link
Contributor Author

kylesayrs commented Apr 23, 2025

@kylesayrs kylesayrs requested a review from dsikka April 24, 2025 14:26
Copy link
Collaborator

@dsikka dsikka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, we should wait to merge until after release

@kylesayrs kylesayrs enabled auto-merge (squash) April 28, 2025 15:15
@kylesayrs kylesayrs merged commit 4438d08 into main Apr 28, 2025
1 check passed
@kylesayrs kylesayrs deleted the kylesayrs/map_module_to_scheme branch April 28, 2025 15:16
kylesayrs added a commit that referenced this pull request Apr 28, 2025
dsikka pushed a commit that referenced this pull request Apr 28, 2025
@brian-dellabetta brian-dellabetta restored the kylesayrs/map_module_to_scheme branch April 28, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants